import torch
def conmh_inference(cfg, data, model):
    if cfg.is_use_parallel and isinstance(model, torch.nn.DataParallel):
        my_H = model.module.inference(data["visual_word"])
    else:
        my_H = model.inference(data["visual_word"])
    my_H = torch.mean(my_H, 1)
    
    BinaryCode = torch.sign(my_H)
    return BinaryCode